import qrcode
import sys

def main():
    num_args = len(sys.argv)
    if num_args > 1:
        print(f"1: {sys.argv[1]}")
        print(f"2: {sys.argv[2]}")
    url = sys.argv[2]
    qr = qrcode.QRCode(
        version=1,
        error_correction=qrcode.constants.ERROR_CORRECT_L,
        box_size=10,
        border=4,
    )
    qr.add_data(url)
    qr.make(fit=True)
    img = qr.make_image(fill_color="black", back_color="white")
    img.save("H:/software_my/qt_model/test/test/qrcode.png")
    print("1111111111 qrcode.png")

if __name__ == "__main__":
    main()
    
    # url = {sys.argv[2]}
    # generate_qrcode(url)
    